//
//  AssociatedTmallGenieViewController.m
//  project
//
//  Created by 张淋 on 2019/6/19.
//  Copyright © 2019 黄建华. All rights reserved.
//

#import "AssociatedTmallGenieViewController.h"

@interface AssociatedTmallGenieViewController ()

@end

@implementation AssociatedTmallGenieViewController

- (void)viewDidLoad {
    self.stateView.backgroundColor = BBIGSTATECOLOR;
    self.navTop.constant = FitSimpleIpx(20, 40);
    [super viewDidLoad];
    __weak typeof(self) weakSelf = self;
    // 获取用户码
    [SN_Net getCodeWithSuccess:^(id object) {
        NSLog(@"object:%@",object);
        __strong typeof(weakSelf) strongSelf = weakSelf;
        strongSelf.codeLabel.text = (NSString *)object;
    } fail:^(id object) {
        NSLog(@"object:%@",object);
    }];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    CustomTabBar *tabBar = (CustomTabBar *)self.tabBarController;
    [tabBar hiddenTheTabBarView];
}

-(void)viewDidLayoutSubviews{
    self.scrollView.contentSize = CGSizeMake(screenWidth,1100);
}

- (IBAction)popAction:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)copyClicked:(UIButton *)sender {
    // 复制用户码至手机的粘贴板
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    [pasteboard setString:self.codeLabel.text];
    SHOWMBProgressHUD(SN_Text(@"已复制"), nil, nil, NO, 1.0);
}
@end
